\(\int \frac {\cos ^3(c+d x) (A+B \cos (c+d x))}{(a+b \cos (c+d x))^3} \, dx\) [266]
Optimal result
Integrand size = 31, antiderivative size = 280 \[
\int \frac {\cos ^3(c+d x) (A+B \cos (c+d x))}{(a+b \cos (c+d x))^3} \, dx=\frac {(A b-3 a B) x}{b^4}-\frac {a \left (2 a^4 A b-5 a^2 A b^3+6 A b^5-6 a^5 B+15 a^3 b^2 B-12 a b^4 B\right ) \arctan \left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{(a-b)^{5/2} b^4 (a+b)^{5/2} d}-\frac {\left (a A b-3 a^2 B+2 b^2 B\right ) \sin (c+d x)}{2 b^3 \left (a^2-b^2\right ) d}+\frac {a (A b-a B) \cos ^2(c+d x) \sin (c+d x)}{2 b \left (a^2-b^2\right ) d (a+b \cos (c+d x))^2}-\frac {a^2 \left (a^2 A b-4 A b^3-3 a^3 B+6 a b^2 B\right ) \sin (c+d x)}{2 b^3 \left (a^2-b^2\right )^2 d (a+b \cos (c+d x))}
\]
[Out]
(A*b-3*B*a)*x/b^4-a*(2*A*a^4*b-5*A*a^2*b^3+6*A*b^5-6*B*a^5+15*B*a^3*b^2-12*B*a*b^4)*arctan((a-b)^(1/2)*tan(1/2
*d*x+1/2*c)/(a+b)^(1/2))/(a-b)^(5/2)/b^4/(a+b)^(5/2)/d-1/2*(A*a*b-3*B*a^2+2*B*b^2)*sin(d*x+c)/b^3/(a^2-b^2)/d+
1/2*a*(A*b-B*a)*cos(d*x+c)^2*sin(d*x+c)/b/(a^2-b^2)/d/(a+b*cos(d*x+c))^2-1/2*a^2*(A*a^2*b-4*A*b^3-3*B*a^3+6*B*
a*b^2)*sin(d*x+c)/b^3/(a^2-b^2)^2/d/(a+b*cos(d*x+c))
Rubi [A] (verified)
Time = 1.72 (sec) , antiderivative size = 280, normalized size of antiderivative = 1.00, number of
steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.194, Rules used = {3068, 3110, 3102, 2814, 2738,
211} \[
\int \frac {\cos ^3(c+d x) (A+B \cos (c+d x))}{(a+b \cos (c+d x))^3} \, dx=\frac {a (A b-a B) \sin (c+d x) \cos ^2(c+d x)}{2 b d \left (a^2-b^2\right ) (a+b \cos (c+d x))^2}-\frac {\left (-3 a^2 B+a A b+2 b^2 B\right ) \sin (c+d x)}{2 b^3 d \left (a^2-b^2\right )}-\frac {a^2 \left (-3 a^3 B+a^2 A b+6 a b^2 B-4 A b^3\right ) \sin (c+d x)}{2 b^3 d \left (a^2-b^2\right )^2 (a+b \cos (c+d x))}-\frac {a \left (-6 a^5 B+2 a^4 A b+15 a^3 b^2 B-5 a^2 A b^3-12 a b^4 B+6 A b^5\right ) \arctan \left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{b^4 d (a-b)^{5/2} (a+b)^{5/2}}+\frac {x (A b-3 a B)}{b^4}
\]
[In]
Int[(Cos[c + d*x]^3*(A + B*Cos[c + d*x]))/(a + b*Cos[c + d*x])^3,x]
[Out]
((A*b - 3*a*B)*x)/b^4 - (a*(2*a^4*A*b - 5*a^2*A*b^3 + 6*A*b^5 - 6*a^5*B + 15*a^3*b^2*B - 12*a*b^4*B)*ArcTan[(S
qrt[a - b]*Tan[(c + d*x)/2])/Sqrt[a + b]])/((a - b)^(5/2)*b^4*(a + b)^(5/2)*d) - ((a*A*b - 3*a^2*B + 2*b^2*B)*
Sin[c + d*x])/(2*b^3*(a^2 - b^2)*d) + (a*(A*b - a*B)*Cos[c + d*x]^2*Sin[c + d*x])/(2*b*(a^2 - b^2)*d*(a + b*Co
s[c + d*x])^2) - (a^2*(a^2*A*b - 4*A*b^3 - 3*a^3*B + 6*a*b^2*B)*Sin[c + d*x])/(2*b^3*(a^2 - b^2)^2*d*(a + b*Co
s[c + d*x]))
Rule 211
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]
Rule 2738
Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x
]}, Dist[2*(e/d), Subst[Int[1/(a + b + (a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}
, x] && NeQ[a^2 - b^2, 0]
Rule 2814
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[b*(x/d)
, x] - Dist[(b*c - a*d)/d, Int[1/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d
, 0]
Rule 3068
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e
_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(-(b*c - a*d))*(B*c - A*d)*Cos[e + f*x]*(a + b*Sin[e + f*x])^(m - 1
)*((c + d*Sin[e + f*x])^(n + 1)/(d*f*(n + 1)*(c^2 - d^2))), x] + Dist[1/(d*(n + 1)*(c^2 - d^2)), Int[(a + b*Si
n[e + f*x])^(m - 2)*(c + d*Sin[e + f*x])^(n + 1)*Simp[b*(b*c - a*d)*(B*c - A*d)*(m - 1) + a*d*(a*A*c + b*B*c -
(A*b + a*B)*d)*(n + 1) + (b*(b*d*(B*c - A*d) + a*(A*c*d + B*(c^2 - 2*d^2)))*(n + 1) - a*(b*c - a*d)*(B*c - A*
d)*(n + 2))*Sin[e + f*x] + b*(d*(A*b*c + a*B*c - a*A*d)*(m + n + 1) - b*B*(c^2*m + d^2*(n + 1)))*Sin[e + f*x]^
2, x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && NeQ[c^2 - d^2
, 0] && GtQ[m, 1] && LtQ[n, -1]
Rule 3102
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (
f_.)*(x_)]^2), x_Symbol] :> Simp[(-C)*Cos[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(m + 2))), x] + Dist[1/(
b*(m + 2)), Int[(a + b*Sin[e + f*x])^m*Simp[A*b*(m + 2) + b*C*(m + 1) + (b*B*(m + 2) - a*C)*Sin[e + f*x], x],
x], x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] && !LtQ[m, -1]
Rule 3110
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])*((A_.) + (B_.)*sin[(e
_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-(b*c - a*d))*(A*b^2 - a*b*B + a^2*C)
*Cos[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b^2*f*(m + 1)*(a^2 - b^2))), x] - Dist[1/(b^2*(m + 1)*(a^2 - b^2)
), Int[(a + b*Sin[e + f*x])^(m + 1)*Simp[b*(m + 1)*((b*B - a*C)*(b*c - a*d) - A*b*(a*c - b*d)) + (b*B*(a^2*d +
b^2*d*(m + 1) - a*b*c*(m + 2)) + (b*c - a*d)*(A*b^2*(m + 2) + C*(a^2 + b^2*(m + 1))))*Sin[e + f*x] - b*C*d*(m
+ 1)*(a^2 - b^2)*Sin[e + f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C}, x] && NeQ[b*c - a*d, 0] &&
NeQ[a^2 - b^2, 0] && LtQ[m, -1]
Rubi steps \begin{align*}
\text {integral}& = \frac {a (A b-a B) \cos ^2(c+d x) \sin (c+d x)}{2 b \left (a^2-b^2\right ) d (a+b \cos (c+d x))^2}-\frac {\int \frac {\cos (c+d x) \left (-2 a (A b-a B)+2 b (A b-a B) \cos (c+d x)+\left (a A b-3 a^2 B+2 b^2 B\right ) \cos ^2(c+d x)\right )}{(a+b \cos (c+d x))^2} \, dx}{2 b \left (a^2-b^2\right )} \\ & = \frac {a (A b-a B) \cos ^2(c+d x) \sin (c+d x)}{2 b \left (a^2-b^2\right ) d (a+b \cos (c+d x))^2}-\frac {a^2 \left (a^2 A b-4 A b^3-3 a^3 B+6 a b^2 B\right ) \sin (c+d x)}{2 b^3 \left (a^2-b^2\right )^2 d (a+b \cos (c+d x))}-\frac {\int \frac {-a b \left (a^2 A b-4 A b^3-3 a^3 B+6 a b^2 B\right )-\left (a^2-b^2\right ) \left (a^2 A b-2 A b^3-3 a^3 B+4 a b^2 B\right ) \cos (c+d x)+b \left (a^2-b^2\right ) \left (a A b-3 a^2 B+2 b^2 B\right ) \cos ^2(c+d x)}{a+b \cos (c+d x)} \, dx}{2 b^3 \left (a^2-b^2\right )^2} \\ & = -\frac {\left (a A b-3 a^2 B+2 b^2 B\right ) \sin (c+d x)}{2 b^3 \left (a^2-b^2\right ) d}+\frac {a (A b-a B) \cos ^2(c+d x) \sin (c+d x)}{2 b \left (a^2-b^2\right ) d (a+b \cos (c+d x))^2}-\frac {a^2 \left (a^2 A b-4 A b^3-3 a^3 B+6 a b^2 B\right ) \sin (c+d x)}{2 b^3 \left (a^2-b^2\right )^2 d (a+b \cos (c+d x))}-\frac {\int \frac {-a b^2 \left (a^2 A b-4 A b^3-3 a^3 B+6 a b^2 B\right )-2 b \left (a^2-b^2\right )^2 (A b-3 a B) \cos (c+d x)}{a+b \cos (c+d x)} \, dx}{2 b^4 \left (a^2-b^2\right )^2} \\ & = \frac {(A b-3 a B) x}{b^4}-\frac {\left (a A b-3 a^2 B+2 b^2 B\right ) \sin (c+d x)}{2 b^3 \left (a^2-b^2\right ) d}+\frac {a (A b-a B) \cos ^2(c+d x) \sin (c+d x)}{2 b \left (a^2-b^2\right ) d (a+b \cos (c+d x))^2}-\frac {a^2 \left (a^2 A b-4 A b^3-3 a^3 B+6 a b^2 B\right ) \sin (c+d x)}{2 b^3 \left (a^2-b^2\right )^2 d (a+b \cos (c+d x))}-\frac {\left (a \left (2 a^4 A b-5 a^2 A b^3+6 A b^5-6 a^5 B+15 a^3 b^2 B-12 a b^4 B\right )\right ) \int \frac {1}{a+b \cos (c+d x)} \, dx}{2 b^4 \left (a^2-b^2\right )^2} \\ & = \frac {(A b-3 a B) x}{b^4}-\frac {\left (a A b-3 a^2 B+2 b^2 B\right ) \sin (c+d x)}{2 b^3 \left (a^2-b^2\right ) d}+\frac {a (A b-a B) \cos ^2(c+d x) \sin (c+d x)}{2 b \left (a^2-b^2\right ) d (a+b \cos (c+d x))^2}-\frac {a^2 \left (a^2 A b-4 A b^3-3 a^3 B+6 a b^2 B\right ) \sin (c+d x)}{2 b^3 \left (a^2-b^2\right )^2 d (a+b \cos (c+d x))}-\frac {\left (a \left (2 a^4 A b-5 a^2 A b^3+6 A b^5-6 a^5 B+15 a^3 b^2 B-12 a b^4 B\right )\right ) \text {Subst}\left (\int \frac {1}{a+b+(a-b) x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{b^4 \left (a^2-b^2\right )^2 d} \\ & = \frac {(A b-3 a B) x}{b^4}-\frac {a \left (2 a^4 A b-5 a^2 A b^3+6 A b^5-6 a^5 B+15 a^3 b^2 B-12 a b^4 B\right ) \arctan \left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{(a-b)^{5/2} b^4 (a+b)^{5/2} d}-\frac {\left (a A b-3 a^2 B+2 b^2 B\right ) \sin (c+d x)}{2 b^3 \left (a^2-b^2\right ) d}+\frac {a (A b-a B) \cos ^2(c+d x) \sin (c+d x)}{2 b \left (a^2-b^2\right ) d (a+b \cos (c+d x))^2}-\frac {a^2 \left (a^2 A b-4 A b^3-3 a^3 B+6 a b^2 B\right ) \sin (c+d x)}{2 b^3 \left (a^2-b^2\right )^2 d (a+b \cos (c+d x))} \\
\end{align*}
Mathematica [A] (verified)
Time = 2.26 (sec) , antiderivative size = 232, normalized size of antiderivative = 0.83
\[
\int \frac {\cos ^3(c+d x) (A+B \cos (c+d x))}{(a+b \cos (c+d x))^3} \, dx=\frac {2 (A b-3 a B) (c+d x)-\frac {2 a \left (-2 a^4 A b+5 a^2 A b^3-6 A b^5+6 a^5 B-15 a^3 b^2 B+12 a b^4 B\right ) \text {arctanh}\left (\frac {(a-b) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {-a^2+b^2}}\right )}{\left (-a^2+b^2\right )^{5/2}}+2 b B \sin (c+d x)+\frac {a^3 b (A b-a B) \sin (c+d x)}{(a-b) (a+b) (a+b \cos (c+d x))^2}+\frac {a^2 b \left (-3 a^2 A b+6 A b^3+5 a^3 B-8 a b^2 B\right ) \sin (c+d x)}{(a-b)^2 (a+b)^2 (a+b \cos (c+d x))}}{2 b^4 d}
\]
[In]
Integrate[(Cos[c + d*x]^3*(A + B*Cos[c + d*x]))/(a + b*Cos[c + d*x])^3,x]
[Out]
(2*(A*b - 3*a*B)*(c + d*x) - (2*a*(-2*a^4*A*b + 5*a^2*A*b^3 - 6*A*b^5 + 6*a^5*B - 15*a^3*b^2*B + 12*a*b^4*B)*A
rcTanh[((a - b)*Tan[(c + d*x)/2])/Sqrt[-a^2 + b^2]])/(-a^2 + b^2)^(5/2) + 2*b*B*Sin[c + d*x] + (a^3*b*(A*b - a
*B)*Sin[c + d*x])/((a - b)*(a + b)*(a + b*Cos[c + d*x])^2) + (a^2*b*(-3*a^2*A*b + 6*A*b^3 + 5*a^3*B - 8*a*b^2*
B)*Sin[c + d*x])/((a - b)^2*(a + b)^2*(a + b*Cos[c + d*x])))/(2*b^4*d)
Maple [A] (verified)
Time = 1.70 (sec) , antiderivative size = 341, normalized size of antiderivative = 1.22
| | |
method | result | size |
| | |
derivativedivides |
\(\frac {-\frac {2 a \left (\frac {\frac {\left (2 A \,a^{2} b -A a \,b^{2}-6 A \,b^{3}-4 B \,a^{3}+B \,a^{2} b +8 B a \,b^{2}\right ) a b \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 \left (a -b \right ) \left (a^{2}+2 a b +b^{2}\right )}+\frac {b a \left (2 A \,a^{2} b +A a \,b^{2}-6 A \,b^{3}-4 B \,a^{3}-B \,a^{2} b +8 B a \,b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 \left (a +b \right ) \left (a -b \right )^{2}}}{{\left (\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a -b \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+a +b \right )}^{2}}+\frac {\left (2 A \,a^{4} b -5 A \,a^{2} b^{3}+6 A \,b^{5}-6 B \,a^{5}+15 B \,a^{3} b^{2}-12 B a \,b^{4}\right ) \arctan \left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{2 \left (a^{4}-2 a^{2} b^{2}+b^{4}\right ) \sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{b^{4}}+\frac {\frac {2 B b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}+2 \left (A b -3 B a \right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{b^{4}}}{d}\) |
\(341\) |
default |
\(\frac {-\frac {2 a \left (\frac {\frac {\left (2 A \,a^{2} b -A a \,b^{2}-6 A \,b^{3}-4 B \,a^{3}+B \,a^{2} b +8 B a \,b^{2}\right ) a b \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 \left (a -b \right ) \left (a^{2}+2 a b +b^{2}\right )}+\frac {b a \left (2 A \,a^{2} b +A a \,b^{2}-6 A \,b^{3}-4 B \,a^{3}-B \,a^{2} b +8 B a \,b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 \left (a +b \right ) \left (a -b \right )^{2}}}{{\left (\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a -b \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+a +b \right )}^{2}}+\frac {\left (2 A \,a^{4} b -5 A \,a^{2} b^{3}+6 A \,b^{5}-6 B \,a^{5}+15 B \,a^{3} b^{2}-12 B a \,b^{4}\right ) \arctan \left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{2 \left (a^{4}-2 a^{2} b^{2}+b^{4}\right ) \sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{b^{4}}+\frac {\frac {2 B b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}+2 \left (A b -3 B a \right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{b^{4}}}{d}\) |
\(341\) |
risch |
\(\text {Expression too large to display}\) |
\(1411\) |
| | |
|
|
|
[In]
int(cos(d*x+c)^3*(A+B*cos(d*x+c))/(a+cos(d*x+c)*b)^3,x,method=_RETURNVERBOSE)
[Out]
1/d*(-2*a/b^4*((1/2*(2*A*a^2*b-A*a*b^2-6*A*b^3-4*B*a^3+B*a^2*b+8*B*a*b^2)*a*b/(a-b)/(a^2+2*a*b+b^2)*tan(1/2*d*
x+1/2*c)^3+1/2*b*a*(2*A*a^2*b+A*a*b^2-6*A*b^3-4*B*a^3-B*a^2*b+8*B*a*b^2)/(a+b)/(a-b)^2*tan(1/2*d*x+1/2*c))/(ta
n(1/2*d*x+1/2*c)^2*a-b*tan(1/2*d*x+1/2*c)^2+a+b)^2+1/2*(2*A*a^4*b-5*A*a^2*b^3+6*A*b^5-6*B*a^5+15*B*a^3*b^2-12*
B*a*b^4)/(a^4-2*a^2*b^2+b^4)/((a-b)*(a+b))^(1/2)*arctan((a-b)*tan(1/2*d*x+1/2*c)/((a-b)*(a+b))^(1/2)))+2/b^4*(
B*b*tan(1/2*d*x+1/2*c)/(1+tan(1/2*d*x+1/2*c)^2)+(A*b-3*B*a)*arctan(tan(1/2*d*x+1/2*c))))
Fricas [B] (verification not implemented)
Leaf count of result is larger than twice the leaf count of optimal. 746 vs. \(2 (268) = 536\).
Time = 0.41 (sec) , antiderivative size = 1561, normalized size of antiderivative = 5.58
\[
\int \frac {\cos ^3(c+d x) (A+B \cos (c+d x))}{(a+b \cos (c+d x))^3} \, dx=\text {Too large to display}
\]
[In]
integrate(cos(d*x+c)^3*(A+B*cos(d*x+c))/(a+b*cos(d*x+c))^3,x, algorithm="fricas")
[Out]
[-1/4*(4*(3*B*a^7*b^2 - A*a^6*b^3 - 9*B*a^5*b^4 + 3*A*a^4*b^5 + 9*B*a^3*b^6 - 3*A*a^2*b^7 - 3*B*a*b^8 + A*b^9)
*d*x*cos(d*x + c)^2 + 8*(3*B*a^8*b - A*a^7*b^2 - 9*B*a^6*b^3 + 3*A*a^5*b^4 + 9*B*a^4*b^5 - 3*A*a^3*b^6 - 3*B*a
^2*b^7 + A*a*b^8)*d*x*cos(d*x + c) + 4*(3*B*a^9 - A*a^8*b - 9*B*a^7*b^2 + 3*A*a^6*b^3 + 9*B*a^5*b^4 - 3*A*a^4*
b^5 - 3*B*a^3*b^6 + A*a^2*b^7)*d*x - (6*B*a^8 - 2*A*a^7*b - 15*B*a^6*b^2 + 5*A*a^5*b^3 + 12*B*a^4*b^4 - 6*A*a^
3*b^5 + (6*B*a^6*b^2 - 2*A*a^5*b^3 - 15*B*a^4*b^4 + 5*A*a^3*b^5 + 12*B*a^2*b^6 - 6*A*a*b^7)*cos(d*x + c)^2 + 2
*(6*B*a^7*b - 2*A*a^6*b^2 - 15*B*a^5*b^3 + 5*A*a^4*b^4 + 12*B*a^3*b^5 - 6*A*a^2*b^6)*cos(d*x + c))*sqrt(-a^2 +
b^2)*log((2*a*b*cos(d*x + c) + (2*a^2 - b^2)*cos(d*x + c)^2 - 2*sqrt(-a^2 + b^2)*(a*cos(d*x + c) + b)*sin(d*x
+ c) - a^2 + 2*b^2)/(b^2*cos(d*x + c)^2 + 2*a*b*cos(d*x + c) + a^2)) - 2*(6*B*a^8*b - 2*A*a^7*b^2 - 17*B*a^6*
b^3 + 7*A*a^5*b^4 + 13*B*a^4*b^5 - 5*A*a^3*b^6 - 2*B*a^2*b^7 + 2*(B*a^6*b^3 - 3*B*a^4*b^5 + 3*B*a^2*b^7 - B*b^
9)*cos(d*x + c)^2 + (9*B*a^7*b^2 - 3*A*a^6*b^3 - 25*B*a^5*b^4 + 9*A*a^4*b^5 + 20*B*a^3*b^6 - 6*A*a^2*b^7 - 4*B
*a*b^8)*cos(d*x + c))*sin(d*x + c))/((a^6*b^6 - 3*a^4*b^8 + 3*a^2*b^10 - b^12)*d*cos(d*x + c)^2 + 2*(a^7*b^5 -
3*a^5*b^7 + 3*a^3*b^9 - a*b^11)*d*cos(d*x + c) + (a^8*b^4 - 3*a^6*b^6 + 3*a^4*b^8 - a^2*b^10)*d), -1/2*(2*(3*
B*a^7*b^2 - A*a^6*b^3 - 9*B*a^5*b^4 + 3*A*a^4*b^5 + 9*B*a^3*b^6 - 3*A*a^2*b^7 - 3*B*a*b^8 + A*b^9)*d*x*cos(d*x
+ c)^2 + 4*(3*B*a^8*b - A*a^7*b^2 - 9*B*a^6*b^3 + 3*A*a^5*b^4 + 9*B*a^4*b^5 - 3*A*a^3*b^6 - 3*B*a^2*b^7 + A*a
*b^8)*d*x*cos(d*x + c) + 2*(3*B*a^9 - A*a^8*b - 9*B*a^7*b^2 + 3*A*a^6*b^3 + 9*B*a^5*b^4 - 3*A*a^4*b^5 - 3*B*a^
3*b^6 + A*a^2*b^7)*d*x - (6*B*a^8 - 2*A*a^7*b - 15*B*a^6*b^2 + 5*A*a^5*b^3 + 12*B*a^4*b^4 - 6*A*a^3*b^5 + (6*B
*a^6*b^2 - 2*A*a^5*b^3 - 15*B*a^4*b^4 + 5*A*a^3*b^5 + 12*B*a^2*b^6 - 6*A*a*b^7)*cos(d*x + c)^2 + 2*(6*B*a^7*b
- 2*A*a^6*b^2 - 15*B*a^5*b^3 + 5*A*a^4*b^4 + 12*B*a^3*b^5 - 6*A*a^2*b^6)*cos(d*x + c))*sqrt(a^2 - b^2)*arctan(
-(a*cos(d*x + c) + b)/(sqrt(a^2 - b^2)*sin(d*x + c))) - (6*B*a^8*b - 2*A*a^7*b^2 - 17*B*a^6*b^3 + 7*A*a^5*b^4
+ 13*B*a^4*b^5 - 5*A*a^3*b^6 - 2*B*a^2*b^7 + 2*(B*a^6*b^3 - 3*B*a^4*b^5 + 3*B*a^2*b^7 - B*b^9)*cos(d*x + c)^2
+ (9*B*a^7*b^2 - 3*A*a^6*b^3 - 25*B*a^5*b^4 + 9*A*a^4*b^5 + 20*B*a^3*b^6 - 6*A*a^2*b^7 - 4*B*a*b^8)*cos(d*x +
c))*sin(d*x + c))/((a^6*b^6 - 3*a^4*b^8 + 3*a^2*b^10 - b^12)*d*cos(d*x + c)^2 + 2*(a^7*b^5 - 3*a^5*b^7 + 3*a^3
*b^9 - a*b^11)*d*cos(d*x + c) + (a^8*b^4 - 3*a^6*b^6 + 3*a^4*b^8 - a^2*b^10)*d)]
Sympy [F(-1)]
Timed out. \[
\int \frac {\cos ^3(c+d x) (A+B \cos (c+d x))}{(a+b \cos (c+d x))^3} \, dx=\text {Timed out}
\]
[In]
integrate(cos(d*x+c)**3*(A+B*cos(d*x+c))/(a+b*cos(d*x+c))**3,x)
[Out]
Timed out
Maxima [F(-2)]
Exception generated. \[
\int \frac {\cos ^3(c+d x) (A+B \cos (c+d x))}{(a+b \cos (c+d x))^3} \, dx=\text {Exception raised: ValueError}
\]
[In]
integrate(cos(d*x+c)^3*(A+B*cos(d*x+c))/(a+b*cos(d*x+c))^3,x, algorithm="maxima")
[Out]
Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*b^2-4*a^2>0)', see `assume?`
for more de
Giac [B] (verification not implemented)
Leaf count of result is larger than twice the leaf count of optimal. 543 vs. \(2 (268) = 536\).
Time = 0.36 (sec) , antiderivative size = 543, normalized size of antiderivative = 1.94
\[
\int \frac {\cos ^3(c+d x) (A+B \cos (c+d x))}{(a+b \cos (c+d x))^3} \, dx=-\frac {\frac {{\left (6 \, B a^{6} - 2 \, A a^{5} b - 15 \, B a^{4} b^{2} + 5 \, A a^{3} b^{3} + 12 \, B a^{2} b^{4} - 6 \, A a b^{5}\right )} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (-2 \, a + 2 \, b\right ) + \arctan \left (-\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {a^{2} - b^{2}}}\right )\right )}}{{\left (a^{4} b^{4} - 2 \, a^{2} b^{6} + b^{8}\right )} \sqrt {a^{2} - b^{2}}} - \frac {4 \, B a^{6} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2 \, A a^{5} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 5 \, B a^{5} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 3 \, A a^{4} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 7 \, B a^{4} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 5 \, A a^{3} b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 8 \, B a^{3} b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 6 \, A a^{2} b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 4 \, B a^{6} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, A a^{5} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 5 \, B a^{5} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 3 \, A a^{4} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 7 \, B a^{4} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 5 \, A a^{3} b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 8 \, B a^{3} b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, A a^{2} b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (a^{4} b^{3} - 2 \, a^{2} b^{5} + b^{7}\right )} {\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a + b\right )}^{2}} + \frac {{\left (3 \, B a - A b\right )} {\left (d x + c\right )}}{b^{4}} - \frac {2 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )} b^{3}}}{d}
\]
[In]
integrate(cos(d*x+c)^3*(A+B*cos(d*x+c))/(a+b*cos(d*x+c))^3,x, algorithm="giac")
[Out]
-((6*B*a^6 - 2*A*a^5*b - 15*B*a^4*b^2 + 5*A*a^3*b^3 + 12*B*a^2*b^4 - 6*A*a*b^5)*(pi*floor(1/2*(d*x + c)/pi + 1
/2)*sgn(-2*a + 2*b) + arctan(-(a*tan(1/2*d*x + 1/2*c) - b*tan(1/2*d*x + 1/2*c))/sqrt(a^2 - b^2)))/((a^4*b^4 -
2*a^2*b^6 + b^8)*sqrt(a^2 - b^2)) - (4*B*a^6*tan(1/2*d*x + 1/2*c)^3 - 2*A*a^5*b*tan(1/2*d*x + 1/2*c)^3 - 5*B*a
^5*b*tan(1/2*d*x + 1/2*c)^3 + 3*A*a^4*b^2*tan(1/2*d*x + 1/2*c)^3 - 7*B*a^4*b^2*tan(1/2*d*x + 1/2*c)^3 + 5*A*a^
3*b^3*tan(1/2*d*x + 1/2*c)^3 + 8*B*a^3*b^3*tan(1/2*d*x + 1/2*c)^3 - 6*A*a^2*b^4*tan(1/2*d*x + 1/2*c)^3 + 4*B*a
^6*tan(1/2*d*x + 1/2*c) - 2*A*a^5*b*tan(1/2*d*x + 1/2*c) + 5*B*a^5*b*tan(1/2*d*x + 1/2*c) - 3*A*a^4*b^2*tan(1/
2*d*x + 1/2*c) - 7*B*a^4*b^2*tan(1/2*d*x + 1/2*c) + 5*A*a^3*b^3*tan(1/2*d*x + 1/2*c) - 8*B*a^3*b^3*tan(1/2*d*x
+ 1/2*c) + 6*A*a^2*b^4*tan(1/2*d*x + 1/2*c))/((a^4*b^3 - 2*a^2*b^5 + b^7)*(a*tan(1/2*d*x + 1/2*c)^2 - b*tan(1
/2*d*x + 1/2*c)^2 + a + b)^2) + (3*B*a - A*b)*(d*x + c)/b^4 - 2*B*tan(1/2*d*x + 1/2*c)/((tan(1/2*d*x + 1/2*c)^
2 + 1)*b^3))/d
Mupad [B] (verification not implemented)
Time = 7.99 (sec) , antiderivative size = 5542, normalized size of antiderivative = 19.79
\[
\int \frac {\cos ^3(c+d x) (A+B \cos (c+d x))}{(a+b \cos (c+d x))^3} \, dx=\text {Too large to display}
\]
[In]
int((cos(c + d*x)^3*(A + B*cos(c + d*x)))/(a + b*cos(c + d*x))^3,x)
[Out]
((tan(c/2 + (d*x)/2)^5*(6*B*a^5 - 2*B*b^5 + 6*A*a^2*b^3 + A*a^3*b^2 + 4*B*a^2*b^3 - 12*B*a^3*b^2 - 2*A*a^4*b +
2*B*a*b^4 - 3*B*a^4*b))/((a*b^3 - b^4)*(a + b)^2) + (tan(c/2 + (d*x)/2)*(6*B*a^5 + 2*B*b^5 + 6*A*a^2*b^3 - A*
a^3*b^2 - 4*B*a^2*b^3 - 12*B*a^3*b^2 - 2*A*a^4*b + 2*B*a*b^4 + 3*B*a^4*b))/((a + b)*(b^5 - 2*a*b^4 + a^2*b^3))
+ (2*tan(c/2 + (d*x)/2)^3*(6*B*a^6 - 2*B*b^6 + 5*A*a^3*b^3 + 6*B*a^2*b^4 - 13*B*a^4*b^2 - 2*A*a^5*b))/(b*(a*b
^2 - b^3)*(a + b)^2*(a - b)))/(d*(2*a*b + tan(c/2 + (d*x)/2)^2*(2*a*b + 3*a^2 - b^2) + tan(c/2 + (d*x)/2)^6*(a
^2 - 2*a*b + b^2) + a^2 + b^2 - tan(c/2 + (d*x)/2)^4*(2*a*b - 3*a^2 + b^2))) + (log(tan(c/2 + (d*x)/2) + 1i)*(
A*b - 3*B*a)*1i)/(b^4*d) - (log(tan(c/2 + (d*x)/2) - 1i)*(A*b*1i - B*a*3i))/(b^4*d) - (a*atan(((a*((8*tan(c/2
+ (d*x)/2)*(4*A^2*b^12 + 72*B^2*a^12 - 8*A^2*a*b^11 - 72*B^2*a^11*b + 24*A^2*a^2*b^10 + 32*A^2*a^3*b^9 - 52*A^
2*a^4*b^8 - 48*A^2*a^5*b^7 + 57*A^2*a^6*b^6 + 32*A^2*a^7*b^5 - 32*A^2*a^8*b^4 - 8*A^2*a^9*b^3 + 8*A^2*a^10*b^2
+ 36*B^2*a^2*b^10 - 72*B^2*a^3*b^9 + 36*B^2*a^4*b^8 + 288*B^2*a^5*b^7 - 288*B^2*a^6*b^6 - 432*B^2*a^7*b^5 + 4
41*B^2*a^8*b^4 + 288*B^2*a^9*b^3 - 288*B^2*a^10*b^2 - 24*A*B*a*b^11 - 48*A*B*a^11*b + 48*A*B*a^2*b^10 - 72*A*B
*a^3*b^9 - 192*A*B*a^4*b^8 + 252*A*B*a^5*b^7 + 288*A*B*a^6*b^6 - 318*A*B*a^7*b^5 - 192*A*B*a^8*b^4 + 192*A*B*a
^9*b^3 + 48*A*B*a^10*b^2))/(a*b^12 + b^13 - 3*a^2*b^11 - 3*a^3*b^10 + 3*a^4*b^9 + 3*a^5*b^8 - a^6*b^7 - a^7*b^
6) + (a*((8*(4*A*b^18 - 8*A*a^2*b^16 + 34*A*a^3*b^15 + 6*A*a^4*b^14 - 36*A*a^5*b^13 - 4*A*a^6*b^12 + 18*A*a^7*
b^11 + 2*A*a^8*b^10 - 4*A*a^9*b^9 + 24*B*a^2*b^16 + 36*B*a^3*b^15 - 78*B*a^4*b^14 - 42*B*a^5*b^13 + 96*B*a^6*b
^12 + 24*B*a^7*b^11 - 54*B*a^8*b^10 - 6*B*a^9*b^9 + 12*B*a^10*b^8 - 12*A*a*b^17 - 12*B*a*b^17))/(a*b^15 + b^16
- 3*a^2*b^14 - 3*a^3*b^13 + 3*a^4*b^12 + 3*a^5*b^11 - a^6*b^10 - a^7*b^9) - (4*a*tan(c/2 + (d*x)/2)*(-(a + b)
^5*(a - b)^5)^(1/2)*(6*A*b^5 - 6*B*a^5 - 5*A*a^2*b^3 + 15*B*a^3*b^2 + 2*A*a^4*b - 12*B*a*b^4)*(8*a*b^17 - 8*a^
2*b^16 - 32*a^3*b^15 + 32*a^4*b^14 + 48*a^5*b^13 - 48*a^6*b^12 - 32*a^7*b^11 + 32*a^8*b^10 + 8*a^9*b^9 - 8*a^1
0*b^8))/((b^14 - 5*a^2*b^12 + 10*a^4*b^10 - 10*a^6*b^8 + 5*a^8*b^6 - a^10*b^4)*(a*b^12 + b^13 - 3*a^2*b^11 - 3
*a^3*b^10 + 3*a^4*b^9 + 3*a^5*b^8 - a^6*b^7 - a^7*b^6)))*(-(a + b)^5*(a - b)^5)^(1/2)*(6*A*b^5 - 6*B*a^5 - 5*A
*a^2*b^3 + 15*B*a^3*b^2 + 2*A*a^4*b - 12*B*a*b^4))/(2*(b^14 - 5*a^2*b^12 + 10*a^4*b^10 - 10*a^6*b^8 + 5*a^8*b^
6 - a^10*b^4)))*(-(a + b)^5*(a - b)^5)^(1/2)*(6*A*b^5 - 6*B*a^5 - 5*A*a^2*b^3 + 15*B*a^3*b^2 + 2*A*a^4*b - 12*
B*a*b^4)*1i)/(2*(b^14 - 5*a^2*b^12 + 10*a^4*b^10 - 10*a^6*b^8 + 5*a^8*b^6 - a^10*b^4)) + (a*((8*tan(c/2 + (d*x
)/2)*(4*A^2*b^12 + 72*B^2*a^12 - 8*A^2*a*b^11 - 72*B^2*a^11*b + 24*A^2*a^2*b^10 + 32*A^2*a^3*b^9 - 52*A^2*a^4*
b^8 - 48*A^2*a^5*b^7 + 57*A^2*a^6*b^6 + 32*A^2*a^7*b^5 - 32*A^2*a^8*b^4 - 8*A^2*a^9*b^3 + 8*A^2*a^10*b^2 + 36*
B^2*a^2*b^10 - 72*B^2*a^3*b^9 + 36*B^2*a^4*b^8 + 288*B^2*a^5*b^7 - 288*B^2*a^6*b^6 - 432*B^2*a^7*b^5 + 441*B^2
*a^8*b^4 + 288*B^2*a^9*b^3 - 288*B^2*a^10*b^2 - 24*A*B*a*b^11 - 48*A*B*a^11*b + 48*A*B*a^2*b^10 - 72*A*B*a^3*b
^9 - 192*A*B*a^4*b^8 + 252*A*B*a^5*b^7 + 288*A*B*a^6*b^6 - 318*A*B*a^7*b^5 - 192*A*B*a^8*b^4 + 192*A*B*a^9*b^3
+ 48*A*B*a^10*b^2))/(a*b^12 + b^13 - 3*a^2*b^11 - 3*a^3*b^10 + 3*a^4*b^9 + 3*a^5*b^8 - a^6*b^7 - a^7*b^6) - (
a*((8*(4*A*b^18 - 8*A*a^2*b^16 + 34*A*a^3*b^15 + 6*A*a^4*b^14 - 36*A*a^5*b^13 - 4*A*a^6*b^12 + 18*A*a^7*b^11 +
2*A*a^8*b^10 - 4*A*a^9*b^9 + 24*B*a^2*b^16 + 36*B*a^3*b^15 - 78*B*a^4*b^14 - 42*B*a^5*b^13 + 96*B*a^6*b^12 +
24*B*a^7*b^11 - 54*B*a^8*b^10 - 6*B*a^9*b^9 + 12*B*a^10*b^8 - 12*A*a*b^17 - 12*B*a*b^17))/(a*b^15 + b^16 - 3*a
^2*b^14 - 3*a^3*b^13 + 3*a^4*b^12 + 3*a^5*b^11 - a^6*b^10 - a^7*b^9) + (4*a*tan(c/2 + (d*x)/2)*(-(a + b)^5*(a
- b)^5)^(1/2)*(6*A*b^5 - 6*B*a^5 - 5*A*a^2*b^3 + 15*B*a^3*b^2 + 2*A*a^4*b - 12*B*a*b^4)*(8*a*b^17 - 8*a^2*b^16
- 32*a^3*b^15 + 32*a^4*b^14 + 48*a^5*b^13 - 48*a^6*b^12 - 32*a^7*b^11 + 32*a^8*b^10 + 8*a^9*b^9 - 8*a^10*b^8)
)/((b^14 - 5*a^2*b^12 + 10*a^4*b^10 - 10*a^6*b^8 + 5*a^8*b^6 - a^10*b^4)*(a*b^12 + b^13 - 3*a^2*b^11 - 3*a^3*b
^10 + 3*a^4*b^9 + 3*a^5*b^8 - a^6*b^7 - a^7*b^6)))*(-(a + b)^5*(a - b)^5)^(1/2)*(6*A*b^5 - 6*B*a^5 - 5*A*a^2*b
^3 + 15*B*a^3*b^2 + 2*A*a^4*b - 12*B*a*b^4))/(2*(b^14 - 5*a^2*b^12 + 10*a^4*b^10 - 10*a^6*b^8 + 5*a^8*b^6 - a^
10*b^4)))*(-(a + b)^5*(a - b)^5)^(1/2)*(6*A*b^5 - 6*B*a^5 - 5*A*a^2*b^3 + 15*B*a^3*b^2 + 2*A*a^4*b - 12*B*a*b^
4)*1i)/(2*(b^14 - 5*a^2*b^12 + 10*a^4*b^10 - 10*a^6*b^8 + 5*a^8*b^6 - a^10*b^4)))/((16*(108*B^3*a^12 - 12*A^3*
a*b^11 - 54*B^3*a^11*b - 24*A^3*a^2*b^10 + 34*A^3*a^3*b^9 + 26*A^3*a^4*b^8 - 36*A^3*a^5*b^7 - 13*A^3*a^6*b^6 +
18*A^3*a^7*b^5 + 2*A^3*a^8*b^4 - 4*A^3*a^9*b^3 + 216*B^3*a^4*b^8 + 216*B^3*a^5*b^7 - 702*B^3*a^6*b^6 - 378*B^
3*a^7*b^5 + 864*B^3*a^8*b^4 + 243*B^3*a^9*b^3 - 486*B^3*a^10*b^2 - 108*A*B^2*a^11*b - 252*A*B^2*a^3*b^9 - 324*
A*B^2*a^4*b^8 + 774*A*B^2*a^5*b^7 + 486*A*B^2*a^6*b^6 - 900*A*B^2*a^7*b^5 - 279*A*B^2*a^8*b^4 + 486*A*B^2*a^9*
b^3 + 54*A*B^2*a^10*b^2 + 96*A^2*B*a^2*b^10 + 156*A^2*B*a^3*b^9 - 282*A^2*B*a^4*b^8 - 198*A^2*B*a^5*b^7 + 312*
A^2*B*a^6*b^6 + 105*A^2*B*a^7*b^5 - 162*A^2*B*a^8*b^4 - 18*A^2*B*a^9*b^3 + 36*A^2*B*a^10*b^2))/(a*b^15 + b^16
- 3*a^2*b^14 - 3*a^3*b^13 + 3*a^4*b^12 + 3*a^5*b^11 - a^6*b^10 - a^7*b^9) + (a*((8*tan(c/2 + (d*x)/2)*(4*A^2*b
^12 + 72*B^2*a^12 - 8*A^2*a*b^11 - 72*B^2*a^11*b + 24*A^2*a^2*b^10 + 32*A^2*a^3*b^9 - 52*A^2*a^4*b^8 - 48*A^2*
a^5*b^7 + 57*A^2*a^6*b^6 + 32*A^2*a^7*b^5 - 32*A^2*a^8*b^4 - 8*A^2*a^9*b^3 + 8*A^2*a^10*b^2 + 36*B^2*a^2*b^10
- 72*B^2*a^3*b^9 + 36*B^2*a^4*b^8 + 288*B^2*a^5*b^7 - 288*B^2*a^6*b^6 - 432*B^2*a^7*b^5 + 441*B^2*a^8*b^4 + 28
8*B^2*a^9*b^3 - 288*B^2*a^10*b^2 - 24*A*B*a*b^11 - 48*A*B*a^11*b + 48*A*B*a^2*b^10 - 72*A*B*a^3*b^9 - 192*A*B*
a^4*b^8 + 252*A*B*a^5*b^7 + 288*A*B*a^6*b^6 - 318*A*B*a^7*b^5 - 192*A*B*a^8*b^4 + 192*A*B*a^9*b^3 + 48*A*B*a^1
0*b^2))/(a*b^12 + b^13 - 3*a^2*b^11 - 3*a^3*b^10 + 3*a^4*b^9 + 3*a^5*b^8 - a^6*b^7 - a^7*b^6) + (a*((8*(4*A*b^
18 - 8*A*a^2*b^16 + 34*A*a^3*b^15 + 6*A*a^4*b^14 - 36*A*a^5*b^13 - 4*A*a^6*b^12 + 18*A*a^7*b^11 + 2*A*a^8*b^10
- 4*A*a^9*b^9 + 24*B*a^2*b^16 + 36*B*a^3*b^15 - 78*B*a^4*b^14 - 42*B*a^5*b^13 + 96*B*a^6*b^12 + 24*B*a^7*b^11
- 54*B*a^8*b^10 - 6*B*a^9*b^9 + 12*B*a^10*b^8 - 12*A*a*b^17 - 12*B*a*b^17))/(a*b^15 + b^16 - 3*a^2*b^14 - 3*a
^3*b^13 + 3*a^4*b^12 + 3*a^5*b^11 - a^6*b^10 - a^7*b^9) - (4*a*tan(c/2 + (d*x)/2)*(-(a + b)^5*(a - b)^5)^(1/2)
*(6*A*b^5 - 6*B*a^5 - 5*A*a^2*b^3 + 15*B*a^3*b^2 + 2*A*a^4*b - 12*B*a*b^4)*(8*a*b^17 - 8*a^2*b^16 - 32*a^3*b^1
5 + 32*a^4*b^14 + 48*a^5*b^13 - 48*a^6*b^12 - 32*a^7*b^11 + 32*a^8*b^10 + 8*a^9*b^9 - 8*a^10*b^8))/((b^14 - 5*
a^2*b^12 + 10*a^4*b^10 - 10*a^6*b^8 + 5*a^8*b^6 - a^10*b^4)*(a*b^12 + b^13 - 3*a^2*b^11 - 3*a^3*b^10 + 3*a^4*b
^9 + 3*a^5*b^8 - a^6*b^7 - a^7*b^6)))*(-(a + b)^5*(a - b)^5)^(1/2)*(6*A*b^5 - 6*B*a^5 - 5*A*a^2*b^3 + 15*B*a^3
*b^2 + 2*A*a^4*b - 12*B*a*b^4))/(2*(b^14 - 5*a^2*b^12 + 10*a^4*b^10 - 10*a^6*b^8 + 5*a^8*b^6 - a^10*b^4)))*(-(
a + b)^5*(a - b)^5)^(1/2)*(6*A*b^5 - 6*B*a^5 - 5*A*a^2*b^3 + 15*B*a^3*b^2 + 2*A*a^4*b - 12*B*a*b^4))/(2*(b^14
- 5*a^2*b^12 + 10*a^4*b^10 - 10*a^6*b^8 + 5*a^8*b^6 - a^10*b^4)) - (a*((8*tan(c/2 + (d*x)/2)*(4*A^2*b^12 + 72*
B^2*a^12 - 8*A^2*a*b^11 - 72*B^2*a^11*b + 24*A^2*a^2*b^10 + 32*A^2*a^3*b^9 - 52*A^2*a^4*b^8 - 48*A^2*a^5*b^7 +
57*A^2*a^6*b^6 + 32*A^2*a^7*b^5 - 32*A^2*a^8*b^4 - 8*A^2*a^9*b^3 + 8*A^2*a^10*b^2 + 36*B^2*a^2*b^10 - 72*B^2*
a^3*b^9 + 36*B^2*a^4*b^8 + 288*B^2*a^5*b^7 - 288*B^2*a^6*b^6 - 432*B^2*a^7*b^5 + 441*B^2*a^8*b^4 + 288*B^2*a^9
*b^3 - 288*B^2*a^10*b^2 - 24*A*B*a*b^11 - 48*A*B*a^11*b + 48*A*B*a^2*b^10 - 72*A*B*a^3*b^9 - 192*A*B*a^4*b^8 +
252*A*B*a^5*b^7 + 288*A*B*a^6*b^6 - 318*A*B*a^7*b^5 - 192*A*B*a^8*b^4 + 192*A*B*a^9*b^3 + 48*A*B*a^10*b^2))/(
a*b^12 + b^13 - 3*a^2*b^11 - 3*a^3*b^10 + 3*a^4*b^9 + 3*a^5*b^8 - a^6*b^7 - a^7*b^6) - (a*((8*(4*A*b^18 - 8*A*
a^2*b^16 + 34*A*a^3*b^15 + 6*A*a^4*b^14 - 36*A*a^5*b^13 - 4*A*a^6*b^12 + 18*A*a^7*b^11 + 2*A*a^8*b^10 - 4*A*a^
9*b^9 + 24*B*a^2*b^16 + 36*B*a^3*b^15 - 78*B*a^4*b^14 - 42*B*a^5*b^13 + 96*B*a^6*b^12 + 24*B*a^7*b^11 - 54*B*a
^8*b^10 - 6*B*a^9*b^9 + 12*B*a^10*b^8 - 12*A*a*b^17 - 12*B*a*b^17))/(a*b^15 + b^16 - 3*a^2*b^14 - 3*a^3*b^13 +
3*a^4*b^12 + 3*a^5*b^11 - a^6*b^10 - a^7*b^9) + (4*a*tan(c/2 + (d*x)/2)*(-(a + b)^5*(a - b)^5)^(1/2)*(6*A*b^5
- 6*B*a^5 - 5*A*a^2*b^3 + 15*B*a^3*b^2 + 2*A*a^4*b - 12*B*a*b^4)*(8*a*b^17 - 8*a^2*b^16 - 32*a^3*b^15 + 32*a^
4*b^14 + 48*a^5*b^13 - 48*a^6*b^12 - 32*a^7*b^11 + 32*a^8*b^10 + 8*a^9*b^9 - 8*a^10*b^8))/((b^14 - 5*a^2*b^12
+ 10*a^4*b^10 - 10*a^6*b^8 + 5*a^8*b^6 - a^10*b^4)*(a*b^12 + b^13 - 3*a^2*b^11 - 3*a^3*b^10 + 3*a^4*b^9 + 3*a^
5*b^8 - a^6*b^7 - a^7*b^6)))*(-(a + b)^5*(a - b)^5)^(1/2)*(6*A*b^5 - 6*B*a^5 - 5*A*a^2*b^3 + 15*B*a^3*b^2 + 2*
A*a^4*b - 12*B*a*b^4))/(2*(b^14 - 5*a^2*b^12 + 10*a^4*b^10 - 10*a^6*b^8 + 5*a^8*b^6 - a^10*b^4)))*(-(a + b)^5*
(a - b)^5)^(1/2)*(6*A*b^5 - 6*B*a^5 - 5*A*a^2*b^3 + 15*B*a^3*b^2 + 2*A*a^4*b - 12*B*a*b^4))/(2*(b^14 - 5*a^2*b
^12 + 10*a^4*b^10 - 10*a^6*b^8 + 5*a^8*b^6 - a^10*b^4))))*(-(a + b)^5*(a - b)^5)^(1/2)*(6*A*b^5 - 6*B*a^5 - 5*
A*a^2*b^3 + 15*B*a^3*b^2 + 2*A*a^4*b - 12*B*a*b^4)*1i)/(d*(b^14 - 5*a^2*b^12 + 10*a^4*b^10 - 10*a^6*b^8 + 5*a^
8*b^6 - a^10*b^4))